import { service } from '@/utils/request'

export function getAllNotices() {
    return service({
      url: `/api/notices/nots/`,
      method: 'get'
    })
}

export function getNotices(pageNum, pageSize) {
  return service({
    url: `/api/notices/nots/${pageNum}/${pageSize}`,
    method: 'get'
  })
}

export function getNoticesById(id) {
    return service({
      url: `/api/notices/nots/${id}`,
      method: 'get'
    })
}

export function searchNotices(queryInfo) {
  return service({
    url: `/api/notices/nots/byKeyword/${queryInfo.pageNum}/${queryInfo.pageSize}?keyword=${queryInfo.query}`,
    method: 'get',
  })
}

export function addNotices(params) {
    return service({
      url: `/api/notices/nots/`,
      method: 'post',
      data: params
    })
}

export function editNotices(id, params) {
    return service({
      url: `/api/notices/nots/${id}`,
      method: 'put',
      data: params
    })
}

export function delNotices(id) {
  return service({
    url: `/api/notices/nots/${id}`,
    method: 'delete',
  })
}